<?php
include 'include/common.php';
$core= new core();
$message_error='';
if(isset($_GET["arg"])){
$decode_arg = base64_decode($_GET["arg"]);
$array_decode_arg = explode("-", $decode_arg);
if(count($array_decode_arg)== 2){
    $event_id= intval($array_decode_arg[0]);
    $guest_id = intval($array_decode_arg[1]);
    $data = $core->db->get_row("SELECT * FROM guest_event WHERE `guest_id`='$guest_id' AND event_id='$event_id'");
    
    if(!$data){
         $message_error='The requested URL was not found';
    }
}else{
     $message_error='Oops, something went wrong. Please try again.';
}
}else{
    $message_error='Oops, something went wrong. Please try again.';
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
        <link rel="stylesheet" type="text/css" href="Client/www/bootstrap/css/bootstrap.css" />
        <link rel="stylesheet" type="text/css" href="Client/www/bootstrap/css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="Client/www/bootstrap/css/bootstrap-responsive.css" />
        <link rel="stylesheet" type="text/css" href="Client/www/bootstrap/css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" type="text/css" href="Client/www/bootstrap/customize/css/style.css" />
        <script type="text/javascript" src="Client/www/js/jquery-1.9.1.min.js"></script>  
        <script type="text/javascript" src="Client/www/bootstrap/js/bootstrap.js"></script>  
        <script type="text/javascript" src="Client/www/bootstrap/js/bootstrap.min.js"></script>  
         <script type="text/javascript" src="Client/www/js/reply_request_address.js?t=1"></script>  
        <title>Reply Address Request</title>  
        <script type="text/javascript">
            var domain = 'http://<?php  echo $_SERVER['SERVER_NAME'];?>';
        </script>
    </head>
    <body>
        <div class="container">
            <form class="form-request">
                <h2 class="form-signin-heading">Reply address request</h2>
                <div class="row-fluid show-grid">
                    <div class="span12 alert alert-error" id="error-msg" style="<?php if($message_error=="") echo "display:none";else echo "display:block";?>">  
                       
                        <?php echo $message_error;?>
                    </div>
                </div>
                <input type="hidden" name="guest_id" value="<?php echo $guest_id;?>"/>
                <input type="hidden" name="event_id" value="<?php echo $event_id;?>"/>
                <input type="hidden" name="error" value="<?php echo $message_error;?>"/>
                <input type="text" name="address" class="input-block-level" placeholder="Address">
                <input type="text" name="city" class="input-block-level" placeholder="City">
                <input type="text" name="state" class="input-block-level" placeholder="State">
                <input type="text" name="zipcode" class="input-block-level" placeholder="Zipcode">
                <button class="btn btn-large btn-primary" type="button" id="submit_address">Submit</button>
            </form>
        </div>
        
    </body>
</html>
